import request from '@/utils/request'

// 查询文件
export function listFileTree(query){
  return request({
    url: "/ranCloud/ranFiles/files",
    method: "get",
    params: query
  })
}

// 下载文件
export function ranFileDownload(pathUrl) {
  return request({
    url:'/ranCloud/ranFiles/download?fileName=' + pathUrl + '&delete=false',
    method: 'get',
    responseType: 'blob',
  })
}

// 创建文件夹
export function ranCreateFile(pathUrl) {
  return request({
    url:'/ranCloud/ranFiles/createFile',
    method: 'post',
    params: {
      path: pathUrl
    }
  })
}

// 删除文件
export function ranDeleteFile(pathUrl) {
  return request({
    url:'/ranCloud/ranFiles/deleteFile',
    method: 'delete',
    params: {
      path: pathUrl
    }
  })
}
